package com.cskaoyan.gateway.controller.shopping;

import com.mall.commons.result.ResponseData;
import com.mall.commons.result.ResponseUtil;
import com.mall.shopping.IContentService;
import com.mall.shopping.dto.NavListResponse;
import com.mall.shopping.dto.PanelContentDto;
import com.mall.user.annotation.Anoymous;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hsp
 * @date 2021/5/24 14:46
 */
@RestController
public class NavigationController {
    @Reference(timeout = 30000,retries = 0,check = false)
    IContentService iContentService;
    @RequestMapping("/shopping/navigation")
    @Anoymous
    public ResponseData navigation(){
        NavListResponse navListResponse = iContentService.queryNavList();



        List<PanelContentDto> pannelContentDtos = navListResponse.getPannelContentDtos();
        ResponseData objectResponseData = new ResponseUtil<>().setData(pannelContentDtos);

        return objectResponseData;
    }
}
